package com.sumainfor.pc.epc.service.impl;

import com.sumainfor.common.utlis.JsonFromObject;
import com.sumainfor.pc.epc.dao.CommodityMapper;
import com.sumainfor.pc.epc.service.CommodityService;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;
import java.util.Map;
import java.util.concurrent.locks.ReentrantLock;

/**
 * @Description:
 */
@Service
public class CommodityImplService implements CommodityService {

    private ReentrantLock lock = new ReentrantLock(false);//

    Logger log = LoggerFactory.getLogger(DecorateServiceimpl.class);// 日志

    @Autowired
    private CommodityMapper commodityMapper;
    /**
     * 根据商品类型查询商品的名称和编号
     * @param params
     * @return
     */
    @Override
    public List<Map<String, Object>> getCommodityByComType(Map<String, Object> params) {

        return commodityMapper.getCommodityByComType(params);
    }
    /**
     * 根据商品编号查询商品对应的规格名称和编号
     * @param params
     * @return
     */
    @Override
    public List<Map<String, Object>> getCommoditySpeByComName(Map<String, Object> params) {
        List<Map<String,Object>> list=commodityMapper.getCommoditySpeByComName(params);
        System.out.println("service:list:"+list);
        return list;
    }
    /**
     * 根据规格编号查询对应的型号和单位
     * @param params
     * @return
     */
    @Override
    public List<Map<String, Object>> getCommoditySpeMoByComSpeName(Map<String, Object> params) {

        return commodityMapper.getCommoditySpeMoByComSpeName(params);
    }
}
